package com.aaa.controller;

import com.aaa.service.impl.DecheckAddServiceImpl;
import com.aaa.service.impl.DecheckServiceImpl;
import com.aaa.vo.DocheckVo;
import com.aaa.entity.CareOrderItem;
import com.aaa.entity.CheckResult;
import com.aaa.vo.Result;
import com.alibaba.fastjson.JSON;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("check/api/docheck")
public class ApiDocheckController {
    @Autowired
    private DecheckServiceImpl decheckService;
    @Resource
    private DecheckAddServiceImpl decheckAddService;

    /**
     * doctor页面查询
     */
    @PostMapping("/doch")
    public Result<List<CareOrderItem>> finduser(@RequestBody DocheckVo docheckVo){
        return decheckService.findAll(docheckVo);
    }

    /**
     * 将已支付的项目进行添加操作
     */
    @PostMapping("/add")
    public Result addcheck (@RequestBody CheckResult checkResult){
        System.out.println("checkResult =================== " + JSON.toJSONString(checkResult));
        boolean b = decheckAddService.addd(checkResult);
        return new Result(200,"添加成功",b);
    }




}
